<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <title>vue 键盘事件</title>
</head>
<body>
<div id="app">
  <form action="">
    <label for="content">请输入内容
      <input type="text" name="content" id="content" v-on:keypress="keypressed">
    </label>
  </form>
</div>

<script type="module">
    import {createApp} from "../../../js/vue.esm-browser.js";

    let app = createApp(
        {
            setup(){

                function keypressed(event) {
                  console.log(event);
                }
                return {
                  keypressed,
                }
            }
        }
    );

    app.mount("#app")
</script>
</body>
</html>